// sgu358
// ml:run = $bin < input
#include <iostream>
#include <algorithm>
#include <vector>

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::vector<int> a(3);
    std::vector<int> b;
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) std::cin >> a[j];
        std::sort(a.begin(), a.end());
        b.push_back(a[1]);
    }
    std::sort(b.begin(), b.end());
    std::cout << b[1] << "\n";
}

